{strip}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
{config_load file="main.conf"}
<head>
    <title>{#title#}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="{$design}style/main.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/head.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/left.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/footer.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/content.css" />
    <link rel="stylesheet" type="text/css" href="{$design}style/markitup.css" />
    {if $smarty.get.action == "change" || $smarty.get.action == "add"}
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript" src="{$design}js/markitup.js"></script>
        <script type="text/javascript" src="{$design}js/ajaxupload.js"></script>
        <script type="text/javascript" src="{$design}js/textarea.js"></script>
    {/if}
</head>
<body>
    <div id="imageupload" style="display: none"></div>
    <div align="center">
        <div class="Main">
            {include file="global/head.tpl"}
            {include file="global/left.tpl"}
            <div class="Content" align="left">
                <div class="Caption">Действие</div>
                <div class="RealContent">
                    <a href="{$curSiteDir}/{$curPage}">Показать новости</a>
                    <a href="{$curSiteDir}/{$curPage}?action=add">Добавить новость</a>
                </div>
                {if !isset($smarty.get.action)}
                    <div class="Caption">Новости</div>
                    <div class="RealContent">
                        <div class="pages">
                            {foreach item=item from=$currentNews}
                                <div class="page">
                                    {$item.caption|truncate:90}
                                    <a href="{$curSiteDir}/{$curPage}?newid={$item.newid}&action=delete">Удалить</a>
                                    <a href="{$curSiteDir}/{$curPage}?newid={$item.newid}&action=change">Изменить</a>
                                    <a href="{$curSiteDir}/{$curPage}?newid={$item.newid}&action=comments">Комментарии</a>
                                    <a href="{$curSiteDir}/{$curPage}?newid={$item.newid}&action=movedown">
                                        <img alt="" src="{$design}images/downArrow.gif" />
                                    </a>
                                    <a href="{$curSiteDir}/{$curPage}?newid={$item.newid}&action=moveup">
                                        <img alt="" src="{$design}images/upArrow.gif" />
                                    </a>
                                </div>
                            {/foreach}
                        </div>
                    </div>
                {/if}

                {if $smarty.get.action == "add"}
                    <div class="Caption">Добавление новой новости</div>
                    <div class="RealContent">
                        <form class="block" method="post" action="{$curSiteDir}/{$curPage}">
                            
                            <div class="inputBlock">
                                <p>
                                    Заголовок
                                </p>
                                <input name="caption" type="text" />
                            </div>
                            <div class="inputBlock">
                                <p>
                                    Автор
                                </p>
                                <input name="author" type="text" />
                            </div>
                            <br clear="left" />

                            <div class="inputBlock">
                                <p>
                                    Текст новости
                                </p>
                                <div id="markitupblock">
                                    <div class="markitupControl">
                                        <img id="bold" alt="bold" src="{$design}images/markitup/bold.png" />
                                        <img id="italic" alt="italic" src="{$design}images/markitup/italic.png" />
                                        <img id="underline" alt="underline" src="{$design}images/markitup/underline.png" />

                                        <span class="razdel">|</span>

                                        <img id="picture" alt="picture" src="{$design}images/markitup/picture.png" />
                                        <img id="link" alt="link" src="{$design}images/markitup/link.png" />

                                        <span class="razdel">|</span>

                                        <div class="markitupElementWithMenu">
                                            <img id="colors" alt="colors" src="{$design}images/markitup/colors.png" />
                                            <table id="tableColors" class="dropMenu" border="0" cellpadding="0" cellspacing="">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <img id="white" class="usual" alt="white" src="{$design}images/markitup/colors/white.png" />
                                                            <img id="white" class="hover" alt="white" src="{$design}images/markitup/colors/white.png" />
                                                        </td>
                                                        <td>
                                                            <img id="gray" class="usual" alt="gray" src="{$design}images/markitup/colors/gray.png" />
                                                            <img id="gray" class="hover" alt="gray" src="{$design}images/markitup/colors/gray.png" />
                                                        </td>
                                                        <td>
                                                            <img id="black" class="usual" alt="black" src="{$design}images/markitup/colors/black.png" />
                                                            <img id="black" class="hover" alt="black" src="{$design}images/markitup/colors/black.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="yellow" class="usual" alt="yellow" src="{$design}images/markitup/colors/yellow.png" />
                                                            <img id="yellow" class="hover" alt="yellow" src="{$design}images/markitup/colors/yellow.png" />
                                                        </td>
                                                        <td>
                                                            <img id="red" class="usual" alt="red" src="{$design}images/markitup/colors/red.png" />
                                                            <img id="red" class="hover" alt="red" src="{$design}images/markitup/colors/red.png" />
                                                        </td>
                                                        <td>
                                                            <img id="green" class="usual" alt="green" src="{$design}images/markitup/colors/green.png" />
                                                            <img id="green" class="hover" alt="green" src="{$design}images/markitup/colors/green.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="blue" class="usual" alt="blue" src="{$design}images/markitup/colors/blue.png" />
                                                            <img id="blue" class="hover" alt="blue" src="{$design}images/markitup/colors/blue.png" />
                                                        </td>
                                                        <td>
                                                            <img id="orange" class="usual" alt="orange" src="{$design}images/markitup/colors/orange.png" />
                                                            <img id="orange" class="hover" alt="orange" src="{$design}images/markitup/colors/orange.png" />
                                                        </td>
                                                        <td>
                                                            <img id="purple" class="usual" alt="purple" src="{$design}images/markitup/colors/purple.png" />
                                                            <img id="purple" class="hover" alt="purple" src="{$design}images/markitup/colors/purple.png" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>

                                        <div class="markitupElementWithMenu">
                                            <img id="fonts" alt="fonts" src="{$design}images/markitup/fonts.png" />
                                            <table id="tableFonts" class="dropMenu" border="0" cellpadding="0" cellspacing="">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <img id="small" class="usual" alt="small" src="{$design}images/markitup/fonts/small.png" />
                                                            <img id="small" class="hover" alt="small" src="{$design}images/markitup/fonts/smallHover.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="normal" class="usual" alt="normal" src="{$design}images/markitup/fonts/normal.png" />
                                                            <img id="normal" class="hover" alt="normal" src="{$design}images/markitup/fonts/normalHover.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="big" class="usual" alt="big" src="{$design}images/markitup/fonts/big.png" />
                                                            <img id="big" class="hover" alt="big" src="{$design}images/markitup/fonts/bigHover.png" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>

                                        <span class="razdel">|</span>

                                        <img id="listBullet" alt="listBullet" src="{$design}images/markitup/listBullet.png" />
                                        <img id="listNumeric" alt="listNumeric" src="{$design}images/markitup/listNumeric.png" />
                                        <img id="listItem" alt="listItem" src="{$design}images/markitup/listItem.png" />

                                        <span class="razdel">|</span>

                                        <img id="quotes" alt="quotes" src="{$design}images/markitup/quotes.png" />
                                        <img id="code" alt="code" src="{$design}images/markitup/code.png" />

                                        <span class="razdel">|</span>

                                        <img id="clean" alt="clean" src="{$design}images/markitup/clean.png" />
                                        <img id="preview" alt="preview" src="{$design}images/markitup/preview.png" />

                                        <div class="emoticons">
                                            <img alt=":)" src="{$design}images/emoticons/emoticon-happy.png" />
                                            <img alt=":(" src="{$design}images/emoticons/emoticon-unhappy.png" />
                                            <img alt=":o" src="{$design}images/emoticons/emoticon-surprised.png" />
                                            <img alt=":p" src="{$design}images/emoticons/emoticon-tongue.png" />
                                            <img alt=";)" src="{$design}images/emoticons/emoticon-wink.png" />
                                            <img alt=":D" src="{$design}images/emoticons/emoticon-smile.png" />
                                        </div>

                                        <br clear="all" />
                                    </div>
                                    <textarea id="bbcode" class="maintext" name="maintext">
                                        {$currentNew.maintext}
                                    </textarea>
                                </div>
                                <img class="imageLoader" src="{$design}images/imageLoader.gif" />
                            </div>
                            <br clear="left" />

                            <div class="inputBlock">
                                <p>
                                    Тэги новости
                                     <span class="info">
                                        программирование, дизайн, ...
                                    </span>
                                </p>
                                <input name="tags" type="text" />
                            </div>
                            <br clear="left" />
                            
                            <br />
                            <input type="submit" value="Добавить" name="newAddEnter" />
                            <input type="reset" value="Очистить" />
                            <input type="submit" value="Отмена" name="cancel" />
                        </form>
                    </div>
                {/if}
                
                {if $smarty.get.action == "change"}
                    <div class="Caption">Изменение новости</div>
                    <div class="RealContent">
                        <form class="block" method="post" action="{$curSiteDir}/{$curPage}">

                            <div class="inputBlock">
                                <p>
                                    Заголовок
                                </p>
                                <input name="caption" type="text" value="{$currentNew.caption}" />
                            </div>
                            <div class="inputBlock">
                                <p>
                                    Автор
                                </p>
                                <input name="author" type="text" value="{$currentNew.author}" />
                            </div>
                            <br clear="left" />

                            <div class="inputBlock">
                                <p>
                                    Текст новости
                                </p>
                                <div id="markitupblock">
                                    <div class="markitupControl">
                                        <img id="bold" alt="bold" src="{$design}images/markitup/bold.png" />
                                        <img id="italic" alt="italic" src="{$design}images/markitup/italic.png" />
                                        <img id="underline" alt="underline" src="{$design}images/markitup/underline.png" />

                                        <span class="razdel">|</span>
                                        
                                        <img id="picture" alt="picture" src="{$design}images/markitup/picture.png" />
                                        <img id="link" alt="link" src="{$design}images/markitup/link.png" />

                                        <span class="razdel">|</span>

                                        <div class="markitupElementWithMenu">
                                            <img id="colors" alt="colors" src="{$design}images/markitup/colors.png" />
                                            <table id="tableColors" class="dropMenu" border="0" cellpadding="0" cellspacing="">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <img id="white" class="usual" alt="white" src="{$design}images/markitup/colors/white.png" />
                                                            <img id="white" class="hover" alt="white" src="{$design}images/markitup/colors/white.png" />
                                                        </td>
                                                        <td>
                                                            <img id="gray" class="usual" alt="gray" src="{$design}images/markitup/colors/gray.png" />
                                                            <img id="gray" class="hover" alt="gray" src="{$design}images/markitup/colors/gray.png" />
                                                        </td>
                                                        <td>
                                                            <img id="black" class="usual" alt="black" src="{$design}images/markitup/colors/black.png" />
                                                            <img id="black" class="hover" alt="black" src="{$design}images/markitup/colors/black.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="yellow" class="usual" alt="yellow" src="{$design}images/markitup/colors/yellow.png" />
                                                            <img id="yellow" class="hover" alt="yellow" src="{$design}images/markitup/colors/yellow.png" />
                                                        </td>
                                                        <td>
                                                            <img id="red" class="usual" alt="red" src="{$design}images/markitup/colors/red.png" />
                                                            <img id="red" class="hover" alt="red" src="{$design}images/markitup/colors/red.png" />
                                                        </td>
                                                        <td>
                                                            <img id="green" class="usual" alt="green" src="{$design}images/markitup/colors/green.png" />
                                                            <img id="green" class="hover" alt="green" src="{$design}images/markitup/colors/green.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="blue" class="usual" alt="blue" src="{$design}images/markitup/colors/blue.png" />
                                                            <img id="blue" class="hover" alt="blue" src="{$design}images/markitup/colors/blue.png" />
                                                        </td>
                                                        <td>
                                                            <img id="orange" class="usual" alt="orange" src="{$design}images/markitup/colors/orange.png" />
                                                            <img id="orange" class="hover" alt="orange" src="{$design}images/markitup/colors/orange.png" />
                                                        </td>
                                                        <td>
                                                            <img id="purple" class="usual" alt="purple" src="{$design}images/markitup/colors/purple.png" />
                                                            <img id="purple" class="hover" alt="purple" src="{$design}images/markitup/colors/purple.png" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>

                                        <div class="markitupElementWithMenu">
                                            <img id="fonts" alt="fonts" src="{$design}images/markitup/fonts.png" />
                                            <table id="tableFonts" class="dropMenu" border="0" cellpadding="0" cellspacing="">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <img id="small" class="usual" alt="small" src="{$design}images/markitup/fonts/small.png" />
                                                            <img id="small" class="hover" alt="small" src="{$design}images/markitup/fonts/smallHover.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="normal" class="usual" alt="normal" src="{$design}images/markitup/fonts/normal.png" />
                                                            <img id="normal" class="hover" alt="normal" src="{$design}images/markitup/fonts/normalHover.png" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <img id="big" class="usual" alt="big" src="{$design}images/markitup/fonts/big.png" />
                                                            <img id="big" class="hover" alt="big" src="{$design}images/markitup/fonts/bigHover.png" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>

                                        <span class="razdel">|</span>

                                        <img id="listBullet" alt="listBullet" src="{$design}images/markitup/listBullet.png" />
                                        <img id="listNumeric" alt="listNumeric" src="{$design}images/markitup/listNumeric.png" />
                                        <img id="listItem" alt="listItem" src="{$design}images/markitup/listItem.png" />

                                        <span class="razdel">|</span>

                                        <img id="quotes" alt="quotes" src="{$design}images/markitup/quotes.png" />
                                        <img id="code" alt="code" src="{$design}images/markitup/code.png" />

                                        <span class="razdel">|</span>

                                        <img id="clean" alt="clean" src="{$design}images/markitup/clean.png" />
                                        <img id="preview" alt="preview" src="{$design}images/markitup/preview.png" />
                                        
                                        <div class="emoticons">
                                            <img alt=":)" src="{$design}images/emoticons/emoticon-happy.png" />
                                            <img alt=":(" src="{$design}images/emoticons/emoticon-unhappy.png" />
                                            <img alt=":o" src="{$design}images/emoticons/emoticon-surprised.png" />
                                            <img alt=":p" src="{$design}images/emoticons/emoticon-tongue.png" />
                                            <img alt=";)" src="{$design}images/emoticons/emoticon-wink.png" />
                                            <img alt=":D" src="{$design}images/emoticons/emoticon-smile.png" />
                                        </div>

                                        <br clear="all" />
                                    </div>
                                    <textarea id="bbcode" class="maintext" name="maintext">
                                        {$currentNew.maintext}
                                    </textarea>
                                </div>
                                <img class="imageLoader" src="{$design}images/imageLoader.gif" />
                            </div>
                            <br clear="left" />

                            <div class="inputBlock">
                                <p>
                                    Тэги новости
                                     <span class="info">
                                        программирование, дизайн, ...
                                    </span>
                                </p>
                                <input name="tags" type="text" value="{$currentNew.tags}" />
                            </div>
                            <br clear="left" />

                            <input type="text" style="display: none;" value="{$currentNew.newid}" name="newid" />

                            <br />
                            <input type="submit" value="Изменить" name="newChangeEnter" />
                            <input type="reset" value="Очистить" />
                            <input type="submit" value="Отмена" name="cancel" />
                        </form>
                    </div>
                {/if}
                
                {if $smarty.get.action == "delete"}
                    <div class="Caption">Удаление страницы {$currentNew.caption}</div>
                    <div class="RealContent">
                        <form class="block" method="post" action="{$curSiteDir}/{$curPage}">
                            <input type="text" style="display: none;" value="{$currentNew.newid}" name="newid" />
                            <p>Действительно ли Вы хотите удалить новость {$currentNew.caption}?</p>
                            <br />
                            <input type="submit" value="Отмена" name="cancel" />
                            <input type="submit" value="Удалить" name="newDeleteEnter" />
                        </form>
                    </div>
                {/if}
                
            </div>
            <br clear="left" />
            {include file="global/footer.tpl"}
        </div>
    </div>
</body>
</html>
{/strip}